using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;

namespace Dogfight2008.Common
{
  public class ColoredTriangle
  {
    public ColoredTriangle(Color color, Triangle triangle)
    {
      if (triangle == null)
        throw new Exception("Expected a Triangle, not null");

      Color = color;
      Triangle = triangle;
    }

    public readonly Triangle Triangle;
    public readonly Color Color;

    public override bool Equals(object obj)
    {
      ColoredTriangle rhs = obj as ColoredTriangle;
      if (rhs == null)
        return false;

      return Color.Equals(rhs.Color);
    }

    public override int GetHashCode()
    {
      unchecked { return Color.GetHashCode() + Triangle.GetHashCode(); }
    }
  }
}
